<?php
require_once 'Zend/Controller/Front.php';
require_once 'Zend/Registry.php';

$controller = Zend_Controller_Front::getInstance();
$controller->setControllerDirectory(array('default'=>'../application/default/controllers'));
$controller->dispatch();

$pdoParams = array(
    'host'           => '127.0.0.1',
    'username'       => 'kelvin',
    'password'       => 'hello',
    'dbname'         => 'tt',
    'driver_options' => array(
						    PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true						   
						)
);
Zend_Registry::set('pdoParams', $pdoParams);

//require_once 'Zend/Controller/Front.php';
//Zend_Controller_Front::run('../application/controllers');
/*
require_once 'Zend/Acl.php';
$acl = new Zend_Acl();

require_once 'Zend/Acl/Role.php';
$acl->addRole(new Zend_Acl_Role('guest'))
    ->addRole(new Zend_Acl_Role('member'))
    ->addRole(new Zend_Acl_Role('admin'));

$parents = array('guest', 'member', 'admin');
$acl->addRole(new Zend_Acl_Role('someUser'), $parents);

require_once 'Zend/Acl/Resource.php';
$acl->add(new Zend_Acl_Resource('someResource'));

$acl->allow('member', 'someResource');
$acl->deny('guest', 'someResource');

echo $acl->isAllowed('someUser', 'someResource') ? 'allowed' : 'denied';

require_once 'Zend/Db/Adapter/Pdo/Mysql.php';

$db = Zend_Db::factory('Pdo_Mysql', $params);
$db->setFetchMode(Zend_Db::FETCH_OBJ);
$result = $db->fetchAll('SELECT * FROM role WHERE id= ?', 2);

echo $result[0]->name;
*/
// $result is an array of objects
//var_dump($result);
//$db->getConnection()->getAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY);

/*

require_once 'Zend/Controller/Front.php';
require_once 'Zend/Controller/Router/Route.php';
require_once 'Zend/Controller/Plugin/Abstract.php';

class MyPlugin extends Zend_Controller_Plugin_Abstract
{
    public function routeStartup(Zend_Controller_Request_Abstract $request)
    {
        $this->getResponse()->appendBody("<p>routeStartup() called</p>\n");
    }

    public function routeShutdown(Zend_Controller_Request_Abstract $request)
    {
        $this->getResponse()->appendBody("<p>routeShutdown() called</p>\n");
    }

    public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
    {
        $this->getResponse()->appendBody("<p>dispatchLoopStartup() called</p>\n");
    }

    public function preDispatch(Zend_Controller_Request_Abstract $request)
    {
        $this->getResponse()->appendBody("<p>preDispatch() called</p>\n");
    }

    public function postDispatch(Zend_Controller_Request_Abstract $request)
    {
        $this->getResponse()->appendBody("<p>postDispatch() called</p>\n");
    }

    public function dispatchLoopShutdown()
    {
        $this->getResponse()->appendBody("<p>dispatchLoopShutdown() called</p>\n");
    }
}

$front = Zend_Controller_Front::getInstance();
$front->setControllerDirectory('../application/controllers')
      ->setRouter(new Zend_Controller_Router_Rewrite())
      ->registerPlugin(new MyPlugin());
$front->dispatch();
*/